package com.hqyj.ssm_project.service;

import com.hqyj.ssm_project.mapper.FunctionMapper;
import com.hqyj.ssm_project.mapper.Role_FunctionMapper;
import com.hqyj.ssm_project.pojo.Function;
import com.hqyj.ssm_project.pojo.Role_Function;
import com.hqyj.ssm_project.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class FunctionServiceImp implements FunctionService{
    @Autowired
    private FunctionMapper functionMapper;
    @Autowired
    private Role_FunctionMapper role_functionMapper;

    @Override
    public int deleteByPrimaryKey(Integer functionId) {
        return functionMapper.deleteByPrimaryKey(functionId);
    }

    @Override
    public int insert(Function row) {
        return functionMapper.insert(row);
    }

    @Override
    public int insertSelective(Function row) {
        return functionMapper.insertSelective(row);
    }

    @Override
    public Function selectByPrimaryKey(Integer functionId) {
        return functionMapper.selectByPrimaryKey(functionId);
    }

    @Override
    public int updateByPrimaryKeySelective(Function row) {
        return functionMapper.updateByPrimaryKeySelective(row);
    }

    @Override
    public int updateByPrimaryKey(Function row) {
        return functionMapper.updateByPrimaryKey(row);
    }

    @Override
    public List<Function> selectAllfunction() {
        return functionMapper.selectAllfunction();
    }

    @Override
    public List<Function> selectFunctionByRoleId(Integer roleId) {
        return functionMapper.selectFunctionByRoleId(roleId);
    }

    @Override
    public List<Role_Function> selectFunctionOneTableByRoleId(Integer roleId) {
        return role_functionMapper.selectFunctionByRoleId(roleId);
    }

    @Override
    public List<Function> selectFunctionByUser(User result) {
        return functionMapper.selectFunctionByUser(result);
    }
}
